var layerId;
var clickState = true;
$(function(){
	$("#save-button").click(function(){
		var brandName = $("input[name='brandName']").val();
		var englishName = $("input[name='englishName']").val();
		var brandId = $("input[name='brandId']").val();
		if(brandName.length == 0){
			layer.msg("请输入品牌名称");
			return false;
		}
		if(englishName.length == 0){
			layer.msg("请输入品牌英文名称");
			return false;
		}
		var goodsBrand ={
			"id":brandId,
			"name":brandName,
			"englishName":englishName
		}
		if(clickState){
			clickState = false;
			$.ajax({
				url:basePath+"/goodsBrand/saveGoodsBrand.shtml",
				data:goodsBrand,
				type:"post",
				dataType:"JSON",
				success:ajaxSuccessCloseFun
			});
			
		}
	});
	$("#close-button").click(function(){
		parent.closeBrandLayer(0);
	});
});
